package bookmanagementsystem.model;

import java.sql.Timestamp;

public class Book {
    private String bookID;
    private String bookName;
    private String authorName;
     Timestamp entryTime;
    private int quantityInLibrary;
    private String location;

    // 主要构造函数，自动生成入库时间（常用情况）
    public Book(String bookID, String bookName, String authorName, int quantityInLibrary, String location) {
        this.bookID = bookID;
        this.bookName = bookName;
        this.authorName = authorName;
        this.entryTime = new Timestamp(System.currentTimeMillis());
        this.quantityInLibrary = quantityInLibrary;
        this.location = location;
    }

    // 备用构造函数，用于在特定情况下传入指定的入库时间（例如从数据库加载已有图书信息时）
    public Book(String bookID, String bookName, String authorName, Timestamp entryTime, int quantityInLibrary, String location) {
        this.bookID = bookID;
        this.bookName = bookName;
        this.authorName = authorName;
        this.entryTime = entryTime;
        this.quantityInLibrary = quantityInLibrary;
        this.location = location;
    }

    // 获取图书ID的方法
    public String getBookID() {
        return bookID;
    }

    // 设置图书ID的方法
    public void setBookID(String bookID) {
        this.bookID = bookID;
    }

    // 获取图书名称的方法
    public String getBookName() {
        return bookName;
    }

    // 设置图书名称的方法
    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    // 获取作者名称的方法
    public String getAuthorName() {
        return authorName;
    }

    // 设置作者名称的方法
    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    // 获取入库时间的方法，按照JavaBean规范修改方法名为getEntryTime
    public Timestamp getEntryTime() {
        return entryTime;
    }

    // 设置入库时间的方法
    public void setEntryTime(Timestamp entryTime) {
        this.entryTime = entryTime;
    }

    // 获取库存数量的方法
    public int getQuantityInLibrary() {
        return quantityInLibrary;
    }

    // 设置库存数量的方法
    public void setQuantityInLibrary(int quantityInLibrary) {
        this.quantityInLibrary = quantityInLibrary;
    }

    // 获取存放位置的方法
    public String getLocation() {
        return location;
    }

    // 设置存放位置的方法
    public void setLocation(String location) {
        this.location = location;
    }


}